package org.fmblzf.library.volley;

import android.content.Context;
import android.widget.Toast;

import com.android.volley.Response;
import com.android.volley.VolleyError;

/**
 * Created by Administrator on 2016/1/28.
 */
public class VolleyErrorListener implements Response.ErrorListener {

    /**
     * 上下文
     */
    private Context mContext;

    /**
     * 构造器
     * @param context
     */
    public VolleyErrorListener(Context context) {
        this.mContext = context;
    }

    @Override
    public void onErrorResponse(VolleyError error) {
        String errorMsg = VolleyErrorHelper.getMessage(error,mContext);
        Toast.makeText(mContext,errorMsg,Toast.LENGTH_LONG).show();
    }
}
